% Test the function makeppft filter.
%
% Yoel Shkolnisky, December 2010.
precision='double';
for n=2:2:16
    A=rand(n,n);

    tic;
    [pp1 pp2]=optimizedPPFT2D(A,precision);
    B=optimizedAdjointPPFT2D(pp1,pp2,precision);
    t1 = toc;
    L=3*n-2; %n+2n-1-1
    H=calculateH(n);
    Hhat=fftn(H,[L L]);

    tic;
    Ahat=fftn(A,[L L]);

    Cc=ifftn(Ahat.*Hhat,[L L]);
    Cc=Cc(n:2*n-1,n:2*n-1);
    t2=toc;

    reportTestResult(n,(norm(B(:)-Cc(:))./norm(B(:))),t1/t2,precision);    
end

